<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="a" style="width: 100%; height: 1300px;background-color: antiquewhite;">
        a
        <div id="b" style="width: 100%; height: 1200px;background-color: burlywood;">
            b
            <div id="c" style="width: 100%; height: 1100px;background-color: cornflowerblue;">
                c
            </div>
        </div>
    </div>
    <script>
        // document属于window
        // https://developer.mozilla.org/en-US/docs/Web/API/Window/document
        var a = document.getElementById('a')
        var b = document.getElementById('b')
        var c = document.getElementById('c')
        window.addEventListener('scroll', function () {
            console.error('window');
        }, false);
        document.addEventListener('scroll', function () {
            console.log('document');
        }, false);
    </script>

</body>

</html>